<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>飞行试验子基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/systemStatic/style/admin.css">
    <link rel="stylesheet" href="/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="/css/public.css">
    <script type="text/javascript">
        var __ctx = "";
    </script>
</head>
<body>

<script type="text/html" template>
<form class="layui-form"  requrl="{{ serverPath.basePath }}/qbdms/wQbdFlighttestChild/get"style="padding: 0px 30px;width: 100%;margin-left: auto;margin-right: auto" lay-filter="wQbdFlighttestChildDataForm">

    <div style="margin: 15px 0px;height: 777px;overflow: auto;">
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">主键</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="id"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">单位名称</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="companyName"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="companyName">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">奖励总人数</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="totalNumberOfAwards"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="totalNumberOfAwards">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">金额</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="sumOfMoney"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="sumOfMoney">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">详细情况</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="details"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="details">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="sort"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="sort">
            </div>
        </div>
        <div class="layui-form-item"style="display: inline-block;">
            <label class="layui-form-label">外键</label>
            <div class="layui-input-block" style="width:650px;">
                <input type="text" name="refid"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="refid">
            </div>
        </div>
    </div>

    <div class="layui-form-item" style="position: fixed;bottom: 15px;left: 0;margin-bottom: 0;width: 100%;">
        <div style="text-align: center;">
            <span id="hideAndShow" style="display: none;">
            <a lay-submit lay-filter="wQbdFlighttestChild" class="layui-btn btn-n privateSubmit" requrl="{{serverPath.basePath}}/qbdms/wQbdFlighttestChild/save">提交</a>
            <a lay-filter="wQbdFlighttestChild" id="run" class="layui-btn btn-n">启动</a>
            </span>
            <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn btn-n layui-btn-danger btn-save">取消</button>
        </div>
    </div>
</form>
</script>
<script src="/public/component.js" type="text/javascript"></script>
<script src="/layui/layui.js"></script>
<script>

    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','common','laydate','jquery','commons','publicMethods'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var commons = layui.commons;
        var publicMethods = layui.publicMethods;
        var dateTimeFiledLen = $(".dateTimeFiled");
        for(var i=0;i<dateTimeFiledLen.length;i++){
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                ,type: 'date'
                ,trigger: 'click'
            });
        }

        //关闭当前页面
        $("#closeWindow").click(function () {
            window.parent.location.href = serverPath.basePath + '/qbdms/wQbdFlighttestChild/view/list';
        });

        var runId = "${runId}";
        if(runId == null || runId == ''){
            $("#hideAndShow").show();
        }

        var common = layui.common;
        var index = parent.parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name:'wQbdFlighttestChildDataForm',
            idValue:"${id}",
            primary:"id",
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    if($(".privateSubmit")){
                        $(".privateSubmit").attr("disabled",false).css("pointer-events","auto");
                    }
                    window.parent.parent.layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        window.parent.parent.layer.close(index);
                        window.parent.location.href = serverPath.basePath + '/qbdms/wQbdFlighttestChild/view/list';
                    });
                } else {
                    window.parent.parent.layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
        });
        $("#run").click(function () {
            var id = $("input[name='id']").val();
            var companyName = $("input[name='companyName']").val();
            var totalNumberOfAwards = $("input[name='totalNumberOfAwards']").val();
            var sumOfMoney = $("input[name='sumOfMoney']").val();
            var details = $("input[name='details']").val();
            var sort = $("input[name='sort']").val();
            var refid = $("input[name='refid']").val();
            var nowData = {"id": id,"companyName": companyName,"totalNumberOfAwards": totalNumberOfAwards,"sumOfMoney": sumOfMoney,"details": details,"sort": sort,"refid": refid};
            $.ajax({
                url:serverPath.workflowPath+"/qbdms/wQbdFlighttestChild/run",
                type: "post",
                dataType: 'json',
                contentType : 'application/json',
                data: JSON.stringify(nowData),
                success : function (data) {
                    if (common.filterRecord(data)) {
                        window.parent.parent.layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                            parent.parent.layer.close(index);
                            window.parent.location.href = serverPath.basePath + '/qbdms/wQbdFlighttestChild/view/list';
                        });
                    } else {
                        window.parent.parent.layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                    }
                    return false;
                },
                error : function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert("启动失败！" + XMLHttpRequest.status);
                }
            })
        })
    });
</script>
</body>
</html>